<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="/zero/resources/dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet" />
<link href="/zero/resources/styles/standard.css" media="screen" type="text/css" rel="stylesheet" />
<link href="/zero/resources/images/favicon.ico" rel="SHORTCUT ICON" />
<script type="text/javascript">
	var djConfig = {
		parseOnLoad : false,
		isDebug : false,
		locale : 'zh'
	};
</script>
<script type="text/javascript" src="/zero/resources/dojo/dojo.js"></script>
<script type="text/javascript" src="/zero/resources/spring/Spring.js"></script>
<script type="text/javascript" src="/zero/resources/spring/Spring-Dojo.js"></script>
<script type="text/javascript" language="JavaScript">
	dojo.require("dojo.parser");
</script>

</head>
<body>

<!-- 			"/tasks?inbox","/tasks?tasks","/tasks?queued","/tasks?involved","/tasks?archived" -->
<c:if test="${param.inbox!=null}">
	<spring:message code="task.menu.inbox" htmlEscape="false" javaScriptEscape="true" var="panel_title"/>
</c:if>
<c:if test="${param.tasks!=null || (param.inbox==null && param.queued==null && param.involved==null && param.archived==null)}">
	<spring:message code="task.menu.tasks" htmlEscape="false" javaScriptEscape="true" var="panel_title"/>
</c:if>
<c:if test="${param.queued!=null}">
	<spring:message code="task.menu.queued" htmlEscape="false" javaScriptEscape="true" var="panel_title"/>
</c:if>
<c:if test="${param.involved!=null}">
	<spring:message code="task.menu.involved" htmlEscape="false" javaScriptEscape="true" var="panel_title"/>
</c:if>
<c:if test="${param.archived!=null}">
	<spring:message code="task.menu.archived" htmlEscape="false" javaScriptEscape="true" var="panel_title"/>
</c:if>

	<script type="text/javascript">
		dojo.require('dijit.TitlePane');
	</script>
	
	<div id="_title_fc_com_ibm_zero_domain_task_id">
		<script type="text/javascript">
			Spring.addDecoration(new Spring.ElementDecoration({
				elementId : '_title_fc_com_ibm_zero_domain_task_id',
				widgetType : 'dijit.TitlePane',
				widgetAttrs : {
					title : '${panel_title}',
					open : true
				}
			}));
		</script>
		
	<table>
		<tr>
			<th><spring:message code="task.name" htmlEscape="false" /></th>
			<th><spring:message code="task.duedate" htmlEscape="false" /></th>
			<th><spring:message code="task.priority" htmlEscape="false" /></th>
			<th><spring:message code="task.description" htmlEscape="false" /></th>
			<th></th>
		</tr>

		<c:forEach items="${tasks }" var="task">
			<tr>
				<td><c:out value="${task.name }" /></td>
				<td><c:out value="${task.dueDate }" /></td>
				<td><c:out value="${task.priority }" /></td>
				<td><c:out value="${task.description }" /></td>
				<td>
					<c:url value="/tasks/${task.id }" var="show_form_url">
					<!-- 针对历史task的特殊标志 -->
						<c:if test="${param.archived!=null }">
							<c:param name="historical"></c:param>
						</c:if>
					</c:url>
					<spring:url value="/resources/images/show.png" var="show_image_url" />
					<spring:message code="entity_show" arguments="${task.id }" argumentSeparator="," htmlEscape="false" var="show_label"/>
					<a href="${show_form_url}" title="show">
						<img alt="${fn:escapeXml(show_label)}" class="image" src="${show_image_url}" title="${fn:escapeXml(show_label)}"  />
					</a>
				</td>
			</tr>
		</c:forEach>
	</table>
	
	</div>
</body>
</html>